package com.xqm.springcloud.service;
import com.xqm.springcloud.pojo.UserInfo;
import com.xqm.springcloud.config.MyFallBackFactory;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

/**
 * @author ShiMing
 * @version 1.0
 * @name UserInfoService
 * @description TODO
 * @date 2020/8/21
 */
//@Component
@FeignClient(value = "SPRING-CLOUD-DEPT-PROVIDER",fallbackFactory = MyFallBackFactory.class)
public interface UserInfoService {

    @GetMapping("/userinfos")
    int deleteByPrimaryKey(String userId);

    @PostMapping("/userinfos")
    int insert(UserInfo record);

    @GetMapping("/userinfos")
    List<UserInfo> selectAll();

    @PutMapping("/userinfos")
    int updateByPrimaryKey(UserInfo record);

    @GetMapping("/userinfos/{phone}")
    UserInfo selectByPhone(@PathVariable String phone);
}
